#include "priors.hpp"

void load_haploid_priors_from_file(std::istream &in, double priors[4][4])
{
    for(unsigned int i = 0; i < 4; i++)
        for(unsigned int j = 0; j < 4; j++)
            in >> priors[i][j];
}

void load_diploid_priors_from_file(std::istream &in, double priors[4][4])
{
    for(unsigned int i = 0; i < 4; i++)
        for(unsigned int j = 0; j < 4; j++)
            in >> priors[i][j];
}

void load_haploid_priors_builtin(double builtin[4][4], double priors[4][4])
{
    for(unsigned int i = 0; i < 4; i++)
        for(unsigned int j = 0; j < 4; j++)
            priors[i][j] = builtin[i][j];
}

void load_diploid_priors_builtin(double builtin[4][4], double priors[4][4])
{
    for(unsigned int i = 0; i < 4; i++)
        for(unsigned int j = 0; j < 4; j++)
            priors[i][j] = builtin[i][j];
}

// haploid bases: A C G T
double haploid_priors_none[4][4] = {
    {0.25,  0.25,  0.25,  0.25},
    {0.25,  0.25,  0.25,  0.25},
    {0.25,  0.25,  0.25,  0.25},
    {0.25,  0.25,  0.25,  0.25}
};

/*
double haploid_priors_high[4][4] = {
    {0.991, 0.003, 0.003, 0.003}, 
    {0.003, 0.991, 0.003, 0.003}, 
    {0.003, 0.003, 0.991, 0.003}, 
    {0.003, 0.003, 0.003, 0.991}
};
*/

double haploid_priors_high[4][4] = { 
{0.99962,     8.89606e-05, 0.000195301, 9.61108e-05 },
{0.000129044, 0.999388,    0.000148366, 0.000334216 },
{0.00033471,  0.000147924, 0.999389,    0.000128156 },
{9.71593e-05, 0.000194758, 8.97149e-05, 0.99962     }
};


double haploid_priors_moderate[4][4] = {
    {0.91,  0.03,  0.03,  0.03}, 
    {0.03,  0.91,  0.03,  0.03}, 
    {0.03,  0.03,  0.91,  0.03}, 
    {0.03,  0.03,  0.03,  0.91}
};

// diploid bases: 
// diploid bases: A C G T
double diploid_priors_none[4][4] = {
//    AA     AC     AG     AT
    {0.25,  0.25,  0.25,  0.25},
//    CC     AC     CG     CT
    {0.25,  0.25,  0.25,  0.25},
//    GG     AG     CG     GT
    {0.25,  0.25,  0.25,  0.25},
//    TT     AT     CT     GT
    {0.25,  0.25,  0.25,  0.25}
};

double diploid_priors_moderate[4][4] = {
//    AA     AC     AG     AT
    {0.91,  0.03,  0.03,  0.03},
//    CC     AC     CG     CT
    {0.91,  0.03,  0.03,  0.03},
//    GG     AG     CG     GT
    {0.91,  0.03,  0.03,  0.03},
//    TT     AT     CT     GT
    {0.91,  0.03,  0.03,  0.03}
};

double diploid_priors_high[4][4] = {
//    AA     AC     AG     AT
    {0.991,  0.003,  0.003,  0.003},
//    CC     AC     CG     CT
    {0.991,  0.003,  0.003,  0.003},
//    GG     AG     CG     GT
    {0.991,  0.003,  0.003,  0.003},
//    TT     AT     CT     GT
    {0.991,  0.003,  0.003,  0.003}
};
